package com.lwj.controller;

import com.github.pagehelper.PageInfo;
import com.lwj.entity.Merchant;
import com.lwj.service.MerchantService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

/**
 * Created by LWJ on 2018/5/14.
 */
@RestController
@RequestMapping("/merchant")
public class MechantController {

    @Autowired
    private MerchantService merchantService;

    @GetMapping("/findAll")
    public PageInfo<Merchant> getAllMerchant(@RequestParam(value = "pageNo",defaultValue ="1" )int pageNo, @RequestParam(value = "pageSize",defaultValue ="1" )int pageSize){
        return merchantService.getAllMerchant(pageNo,pageSize);
    }
}
